library(base)
library(tidyr)
library(dplyr)
Attaching package: ‘dplyr’
The following objects are masked from ‘package:stats’:
filter, lag
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
library(plotly)Loading required package: ggplot2
Attaching package: ‘plotly’
The following object is masked from ‘package:ggplot2’:
last_plot
The following object is masked from ‘package:stats’:
filter
The following object is masked from ‘package:graphics’:
layout
library(lubridate)
Attaching package: ‘lubridate’
The following objects are masked from ‘package:base’:
date, intersect, setdiff, union
library(ggplot2)
library(ggmap)Google's Terms of Service: https://cloud.google.com/maps-platform/terms/.
Please cite ggmap if you use it! See citation("ggmap") for details.
Attaching package: ‘ggmap’
The following object is masked from ‘package:plotly’:
wind
library(plotKML)plotKML version 0.8-2 (2021-10-06)
URL: https://github.com/Envirometrix/plotKML/
library(Xmisc)
Attaching package: ‘Xmisc’
The following object is masked from ‘package:base’:
dir.exists
df <- read.csv("~/Desktop/Data/strava_data/activities.csv")
head(df)Activity.ID <dbl> | Activity.Date <chr> | Activity.Name <chr> | Activity.year <int> | Activity.Time <chr> | Elapsed.Time <int> | Distance <chr> | ||
|---|---|---|---|---|---|---|---|---|
| 1 | 456313795 | 26-Dec | Morning Ride | 2015 | 4:41:38 AM | 5686 | 28.21 | |
| 2 | 481501770 | 30-Jan | Morning Ride | 2016 | 2:40:05 AM | 6282 | 30.2 | |
| 3 | 483950898 | 2-Feb | Morning Ride | 2016 | 2:21:51 AM | 6923 | 29.94 | |
| 4 | 485107191 | 3-Feb | Night Ride | 2016 | 4:30:58 PM | 5249 | 22.12 | |
| 5 | 485447489 | 4-Feb | Morning Ride | 2016 | 2:37:30 AM | 5664 | 30.15 | |
| 6 | 486170323 | 5-Feb | Morning Ride | 2016 | 2:37:59 AM | 3883 | 13.23 |
df %>%
group_by(df$Activity.Time)%>%
filter(df , Activity.Name == "Morning Ride | Morning ride" )
Error: Problem with `filter()` input `..1`.
ℹ Input `..1` is `df`.
x Input `..1$lon` must be a logical vector, not a double.
Run `rlang::last_error()` to see where the error occurred.
#Plotting the
library(plotly)
fig <- plot_ly(df, type = 'scatter', mode = 'lines')%>%
add_trace(x = df$lon, y = df$lat)%>%
layout(showlegend = F)
fig <- fig %>%
layout(
xaxis = list(zerolinecolor = '#ffff',
zerolinewidth = 2,
gridcolor = 'ffff'),
yaxis = list(zerolinecolor = '#ffff',
zerolinewidth = 2,
gridcolor = 'ffff'),
plot_bgcolor='#e5ecf6', width = 900)
fig
#distribution of Rides over the years
#library(plotly)
#labels = c('lat','long','ele')
#values = select(df , 1,2,3)
#fig <- plot_ly(type='pie', labels=labels, values=values,
# textinfo='label+percent',
# insidetextorientation='radial')
#figlibrary(plotly)
# fig <- fig %>% add_trace( ... )
# fig <- fig %>% layout( ... )
library(dash)
library(dashCoreComponents)
library(dashHtmlComponents)
app <- Dash$new()
app$layout(
htmlDiv(
list(
dccGraph(figure=fig)
)
)
)
app$run_server(debug=TRUE, dev_tools_hot_reload=FALSE)
library(plotKML)
library(XML)
geodf <- readGPX("/Users/dhwani/Desktop/Data/strava_data/activities/456313795.gpx")
shift.vec <- function (vec, shift) {
if(length(vec) <= abs(shift)) {
rep(NA ,length(vec))
}else{
if (shift >= 0) {
c(rep(NA, shift), vec[1:(length(vec)-shift)]) }
else {
c(vec[(abs(shift)+1):length(vec)], rep(NA, abs(shift))) } } }
geodf$lat.p1 <- shift.vec(geodf$lat, -1)
geodf$lon.p1 <- shift.vec(geodf$lon, -1)
pfile <- htmlTreeParse(file = "/Users/dhwani/Desktop/Data/strava_data/activities/456313795.gpx", error = function(...) {
}, useInternalNodes = T)
elevations <- as.numeric(xpathSApply(pfile, path = "//trkpt/ele", xmlValue))
times <- xpathSApply(pfile, path = "//trkpt/time", xmlValue)
coords <- xpathSApply(pfile, path = "//trkpt", xmlAttrs)
# Extract latitude and longitude from the coordinates
lats <- as.numeric(coords["lat",])
lons <- as.numeric(coords["lon",])
geodf <- data.frame(lat = lats, lon = lons, ele = elevations, time = times)
rm(list=c("elevations", "lats", "lons", "pfile", "times", "coords"))
head(geodf)lat <dbl> | lon <dbl> | ele <dbl> | time <chr> | |
|---|---|---|---|---|
| 1 | 21.52129 | 72.12310 | 95.0 | 2015-12-26T04:41:38Z |
| 2 | 21.52137 | 72.12305 | 95.1 | 2015-12-26T04:41:40Z |
| 3 | 21.52135 | 72.12302 | 95.1 | 2015-12-26T04:43:11Z |
| 4 | 21.52132 | 72.12301 | 95.1 | 2015-12-26T04:44:18Z |
| 5 | 21.52128 | 72.12296 | 95.0 | 2015-12-26T04:44:57Z |
| 6 | 21.52127 | 72.12293 | 95.0 | 2015-12-26T04:44:59Z |
plot(rev(geodf$lon), rev(geodf$lat), type = "l", col = "red", lwd = 3, bty = "n", ylab = "Latitude", xlab = "Longitude")
fig <- plot_ly(geodf, x =rev(geodf$lon) , y = rev(geodf$lat), type = 'scatter', mode = 'lines' )
figNA
NA
NA
NA#adding all the coordinates of all the activities in GPX files.
library(tidyr)
library(tidyverse)
library(plotKML)
files <- list.files(path="/Users/dhwani/Desktop/export_22293992/activities", pattern = "*.gpx",full.names = T)
list(files)[[1]]
[1] "/Users/dhwani/Desktop/export_22293992/activities/1011255489.gpx"
[2] "/Users/dhwani/Desktop/export_22293992/activities/1014337963.gpx"
[3] "/Users/dhwani/Desktop/export_22293992/activities/1020046528.gpx"
[4] "/Users/dhwani/Desktop/export_22293992/activities/1032603690.gpx"
[5] "/Users/dhwani/Desktop/export_22293992/activities/1037221540.gpx"
[6] "/Users/dhwani/Desktop/export_22293992/activities/1038839050.gpx"
[7] "/Users/dhwani/Desktop/export_22293992/activities/1040820341.gpx"
[8] "/Users/dhwani/Desktop/export_22293992/activities/1046670633.gpx"
[9] "/Users/dhwani/Desktop/export_22293992/activities/1260608781.gpx"
[10] "/Users/dhwani/Desktop/export_22293992/activities/1405372528.gpx"
[11] "/Users/dhwani/Desktop/export_22293992/activities/1405372868.gpx"
[12] "/Users/dhwani/Desktop/export_22293992/activities/5964755256.gpx"
[13] "/Users/dhwani/Desktop/export_22293992/activities/6102134068.gpx"
[14] "/Users/dhwani/Desktop/export_22293992/activities/6107195950.gpx"
[15] "/Users/dhwani/Desktop/export_22293992/activities/6111841667.gpx"
[16] "/Users/dhwani/Desktop/export_22293992/activities/6118316052.gpx"
[17] "/Users/dhwani/Desktop/export_22293992/activities/6123486209.gpx"
[18] "/Users/dhwani/Desktop/export_22293992/activities/6129172599.gpx"
[19] "/Users/dhwani/Desktop/export_22293992/activities/6140990413.gpx"
[20] "/Users/dhwani/Desktop/export_22293992/activities/6145459128.gpx"
[21] "/Users/dhwani/Desktop/export_22293992/activities/6151790905.gpx"
[22] "/Users/dhwani/Desktop/export_22293992/activities/6201329047.gpx"
[23] "/Users/dhwani/Desktop/export_22293992/activities/6210896942.gpx"
[24] "/Users/dhwani/Desktop/export_22293992/activities/6257216107.gpx"
trks1 <- readGPX("/Users/dhwani/Desktop/export_22293992/activities/1011255489.gpx", tracks = TRUE)
trks2 <- readGPX("/Users/dhwani/Desktop/export_22293992/activities/1014337963.gpx", tracks = TRUE)
trks3 <- readGPX("/Users/dhwani/Desktop/export_22293992/activities/1020046528.gpx", tracks = TRUE)
trks4 <- readGPX("/Users/dhwani/Desktop/export_22293992/activities/1032603690.gpx", tracks = TRUE)
trks5 <- readGPX("/Users/dhwani/Desktop/export_22293992/activities/1037221540.gpx", tracks = TRUE)
trks6 <- readGPX("/Users/dhwani/Desktop/export_22293992/activities/1038839050.gpx", tracks = TRUE)
trks7 <- readGPX("/Users/dhwani/Desktop/export_22293992/activities/1040820341.gpx", tracks = TRUE)
trks8 <- readGPX("/Users/dhwani/Desktop/export_22293992/activities/1046670633.gpx", tracks = TRUE)
trks9 <- readGPX("/Users/dhwani/Desktop/export_22293992/activities/1260608781.gpx", tracks = TRUE)
trks10 <- readGPX("/Users/dhwani/Desktop/export_22293992/activities/1405372528.gpx", tracks = TRUE)
trks11<- readGPX("/Users/dhwani/Desktop/export_22293992/activities/1405372868.gpx", tracks = TRUE)
trks12 <- readGPX("/Users/dhwani/Desktop/export_22293992/activities/5964755256.gpx", tracks = TRUE)
trks13 <- readGPX("/Users/dhwani/Desktop/export_22293992/activities/6102134068.gpx", tracks = TRUE)
trks14 <- readGPX("/Users/dhwani/Desktop/export_22293992/activities/6107195950.gpx", tracks = TRUE)
trks15 <- readGPX("/Users/dhwani/Desktop/export_22293992/activities/6111841667.gpx", tracks = TRUE)
trks16 <- readGPX("/Users/dhwani/Desktop/export_22293992/activities/6118316052.gpx", tracks = TRUE)
trks17 <- readGPX("/Users/dhwani/Desktop/export_22293992/activities/6123486209.gpx", tracks = TRUE)
trks18 <- readGPX("/Users/dhwani/Desktop/export_22293992/activities/6129172599.gpx", tracks = TRUE)
trks19 <- readGPX("/Users/dhwani/Desktop/export_22293992/activities/6140990413.gpx", tracks = TRUE)
trks20 <- readGPX("/Users/dhwani/Desktop/export_22293992/activities/6145459128.gpx", tracks = TRUE)
trks21 <- readGPX("/Users/dhwani/Desktop/export_22293992/activities/6151790905.gpx", tracks = TRUE)
trks22 <- readGPX("/Users/dhwani/Desktop/export_22293992/activities/6201329047.gpx", tracks = TRUE)
trks23 <- readGPX("/Users/dhwani/Desktop/export_22293992/activities/6210896942.gpx", tracks = TRUE)
trks24 <- readGPX("/Users/dhwani/Desktop/export_22293992/activities/6257216107.gpx", tracks = TRUE)
route1 <- data.frame(trks1$tracks[[1]]$`Evening Run`)
route2 <- data.frame(trks2$tracks[[1]]$`Evening Run`)
route3 <- data.frame(trks3$tracks[[1]]$`Morning Ride`)
route4 <- data.frame(trks4$tracks[[1]]$`Morning Ride`)
route5 <- data.frame(trks5$tracks[[1]]$`Morning Ride`)
route6 <- data.frame(trks6$tracks[[1]]$`Morning Ride`)
route7 <- data.frame(trks7$tracks[[1]]$`Afternoon Run`)
route8 <- data.frame(trks8$tracks[[1]]$`Evening Ride`)
route9 <- data.frame(trks9$tracks[[1]]$`Afternoon Run`)
route10 <- data.frame(trks10$tracks[[1]]$`Morning Run`)
route11 <- data.frame(trks11$tracks[[1]]$`Morning Run`)
route12 <- data.frame(trks12$tracks[[1]]$`Evening Walk`)
route13 <- data.frame(trks13$tracks[[1]]$`First walk in Boston `)
route14 <- data.frame(trks14$tracks[[1]]$`Morning Walk`)
route15 <- data.frame(trks15$tracks[[1]]$`Fall `)
route16 <- data.frame(trks16$tracks[[1]]$`Short walk`)
route17 <- data.frame(trks17$tracks[[1]]$`Across the river `)
route18 <- data.frame(trks18$tracks[[1]]$`Afternoon Walk`)
route19 <- data.frame(trks19$tracks[[1]]$`Run walk run`)
route20 <- data.frame(trks20$tracks[[1]]$`Morning Walk`)
route21 <- data.frame(trks21$tracks[[1]]$`Weekend blast`)
route22 <- data.frame(trks22$tracks[[1]]$`Morning Walk`)
route23 <- data.frame(trks23$tracks[[1]]$`Morning Walk`)
route24 <- data.frame(trks24$tracks[[1]]$`Morning Walk`)
df_1 <- bind_rows(route1,route2,route3, route4, route5, route6, route7, route8, route9, route10, route11, route12, route13, route14, route15, route16, route17, route18, route19, route20, route21, route22, route23, route24)
fig <- plot_ly(df, x =rev(df$lon) , y = rev(df$lat), type = 'scatter', mode = 'lines' )
fig
get_lat_lon <- function(df){
df <- df[,c(1,2,3)]
}
route1 <- get_lat_lon(route1)
route2 <- get_lat_lon(route2)
route3 <- get_lat_lon(route3)
route4 <- get_lat_lon(route4)
route5 <- get_lat_lon(route5)
route6 <- get_lat_lon(route6)
route7 <- get_lat_lon(route7)
route8 <- get_lat_lon(route8)
route9 <- get_lat_lon(route9)
route10 <- get_lat_lon(route10)
route11 <- get_lat_lon(route11)
route12 <- get_lat_lon(route12)
route13 <- get_lat_lon(route13)
route14 <- get_lat_lon(route14)
route15 <- get_lat_lon(route15)
route16 <- get_lat_lon(route16)
route17 <- get_lat_lon(route17)
route18 <- get_lat_lon(route18)
route19 <- get_lat_lon(route19)
route20 <- get_lat_lon(route20)
route21 <- get_lat_lon(route21)
route22 <- get_lat_lon(route22)
route23 <- get_lat_lon(route23)#Plotting routes on static map
library(ggmap)
register_google(key = "AIzaSyASpNyC1jMyQWfQXPB3jvP7gZtqF5bMHL0")
#since we want a static map and we want to plot all the activities, we decided to take the mean of the latitude and the longitude.
lon_1 <- median(df_1$lon)
lat_1 <- median(df_1$lat)
mapImageData <- get_map(center = c(lon = 72.23048, lat = 21.68353), zoom = 11,
# size = c(500, 500),
maptype = c("terrain"))Warning: center argument deprecated, use location.
Source : https://maps.googleapis.com/maps/api/staticmap?center=21.68353,72.23048&zoom=11&size=640x640&scale=2&maptype=terrain&language=en-EN&key=xxx
longitude <- df_1$lon
longitude [1] 72.13675 72.13677 72.13679 72.13673 72.13671 72.13667 72.13664
[8] 72.13661 72.13658 72.13654 72.13651 72.13647 72.13644 72.13641
[15] 72.13638 72.13634 72.13631 72.13578 72.13575 72.13572 72.13569
[22] 72.13566 72.13563 72.13559 72.13556 72.13552 72.13549 72.13546
[29] 72.13542 72.13538 72.13535 72.13531 72.13526 72.13524 72.13519
[36] 72.13516 72.13513 72.13510 72.13506 72.13503 72.13499 72.13496
[43] 72.13492 72.13487 72.13484 72.13481 72.13478 72.13475 72.13471
[50] 72.13467 72.13463 72.13460 72.13455 72.13451 72.13447 72.13444
[57] 72.13440 72.13437 72.13433 72.13430 72.13427 72.13424 72.13421
[64] 72.13417 72.13414 72.13411 72.13407 72.13403 72.13400 72.13396
[71] 72.13393 72.13390 72.13387 72.13384 72.13381 72.13378 72.13374
[78] 72.13371 72.13368 72.13364 72.13360 72.13357 72.13352 72.13349
[85] 72.13346 72.13342 72.13339 72.13335 72.13331 72.13326 72.13324
[92] 72.13321 72.13318 72.13314 72.13310 72.13306 72.13303 72.13300
[99] 72.13297 72.13293 72.13289 72.13285 72.13281 72.13277 72.13274
[106] 72.13271 72.13268 72.13264 72.13261 72.13258 72.13255 72.13252
[113] 72.13249 72.13246 72.13243 72.13240 72.13237 72.13233 72.13230
[120] 72.13227 72.13224 72.13220 72.13216 72.13214 72.13210 72.13206
[127] 72.13202 72.13199 72.13195 72.13192 72.13188 72.13184 72.13180
[134] 72.13177 72.13174 72.13171 72.13167 72.13164 72.13159 72.13155
[141] 72.13152 72.13149 72.13146 72.13142 72.13139 72.13136 72.13133
[148] 72.13131 72.13126 72.13122 72.13120 72.13117 72.13114 72.13111
[155] 72.13108 72.13106 72.13102 72.13099 72.13095 72.13092 72.13089
[162] 72.13086 72.13083 72.13079 72.13076 72.13072 72.13068 72.13064
[169] 72.13061 72.13057 72.13054 72.13051 72.13048 72.13044 72.13041
[176] 72.13038 72.13034 72.13030 72.13027 72.13024 72.13021 72.13018
[183] 72.13015 72.13012 72.13009 72.13005 72.13002 72.13000 72.12996
[190] 72.12993 72.12989 72.12985 72.12982 72.12979 72.12977 72.12974
[197] 72.12970 72.12966 72.12963 72.12959 72.12957 72.12953 72.12950
[204] 72.12946 72.12942 72.12939 72.12935 72.12932 72.12928 72.12924
[211] 72.12921 72.12918 72.12914 72.12911 72.12907 72.12903 72.12900
[218] 72.12897 72.12894 72.12891 72.12887 72.12883 72.12880 72.12876
[225] 72.12873 72.12869 72.12867 72.12863 72.12860 72.12856 72.12854
[232] 72.12851 72.12848 72.12845 72.12843 72.12840 72.12838 72.12835
[239] 72.12832 72.12829 72.12827 72.12824 72.12821 72.12820 72.12817
[246] 72.12814 72.12811 72.12809 72.12806 72.12804 72.12801 72.12799
[253] 72.12798 72.12796 72.12793 72.12793 72.12790 72.12788 72.12785
[260] 72.12783 72.12781 72.12778 72.12776 72.12775 72.12773 72.12772
[267] 72.12771 72.12769 72.12766 72.12764 72.12764 72.12762 72.12761
[274] 72.12759 72.12757 72.12755 72.12754 72.12753 72.12751 72.12748
[281] 72.12746 72.12744 72.12742 72.12739 72.12738 72.12736 72.12733
[288] 72.12731 72.12729 72.12727 72.12726 72.12723 72.12721 72.12720
[295] 72.12718 72.12715 72.12713 72.12712 72.12710 72.12710 72.12708
[302] 72.12706 72.12704 72.12702 72.12699 72.12697 72.12694 72.12692
[309] 72.12689 72.12685 72.12682 72.12680 72.12677 72.12675 72.12673
[316] 72.12671 72.12667 72.12665 72.12663 72.12660 72.12658 72.12655
[323] 72.12652 72.12650 72.12647 72.12644 72.12641 72.12638 72.12635
[330] 72.12633 72.12629 72.12627 72.12626 72.12623 72.12620 72.12618
[337] 72.12615 72.12613 72.12611 72.12608 72.12606 72.12603 72.12600
[344] 72.12596 72.12592 72.12587 72.12584 72.12581 72.12577 72.12574
[351] 72.12570 72.12566 72.12562 72.12558 72.12555 72.12552 72.12549
[358] 72.12546 72.12543 72.12539 72.12536 72.12532 72.12528 72.12524
[365] 72.12520 72.12516 72.12512 72.12510 72.12507 72.12504 72.12501
[372] 72.12497 72.12495 72.12492 72.12489 72.12487 72.12484 72.12481
[379] 72.12479 72.12477 72.12475 72.12473 72.12472 72.12471 72.12471
[386] 72.12470 72.12469 72.12468 72.12468 72.12468 72.12467 72.12466
[393] 72.12465 72.12464 72.12462 72.12461 72.12461 72.12460 72.12459
[400] 72.12458 72.12457 72.12457 72.12456 72.12454 72.12453 72.12453
[407] 72.12453 72.12452 72.12451 72.12448 72.12446 72.12446 72.12443
[414] 72.12441 72.12439 72.12437 72.12436 72.12434 72.12431 72.12428
[421] 72.12426 72.12424 72.12422 72.12420 72.12417 72.12414 72.12411
[428] 72.12408 72.12405 72.12403 72.12400 72.12396 72.12393 72.12389
[435] 72.12386 72.12383 72.12380 72.12377 72.12373 72.12369 72.12367
[442] 72.12363 72.12360 72.12357 72.12354 72.12353 72.12351 72.12349
[449] 72.12349 72.12349 72.12349 72.12350 72.12350 72.12351 72.12354
[456] 72.12356 72.12358 72.12360 72.12363 72.12366 72.12369 72.12371
[463] 72.12374 72.12377 72.12381 72.12384 72.12387 72.12390 72.12394
[470] 72.12397 72.12400 72.12402 72.12404 72.12406 72.12408 72.12410
[477] 72.12413 72.12416 72.12418 72.12419 72.12421 72.12423 72.12426
[484] 72.12428 72.12430 72.12432 72.12434 72.12436 72.12438 72.12440
[491] 72.12441 72.12442 72.12444 72.12446 72.12449 72.12451 72.12453
[498] 72.12456 72.12458 72.12461 72.12463 72.12466 72.12468 72.12472
[505] 72.12475 72.12478 72.12482 72.12486 72.12489 72.12492 72.12496
[512] 72.12499 72.12504 72.12507 72.12512 72.12515 72.12519 72.12522
[519] 72.12525 72.12529 72.12532 72.12535 72.12537 72.12540 72.12543
[526] 72.12546 72.12550 72.12554 72.12557 72.12560 72.12563 72.12566
[533] 72.12569 72.12573 72.12576 72.12578 72.12580 72.12583 72.12584
[540] 72.12586 72.12588 72.12590 72.12594 72.12597 72.12600 72.12602
[547] 72.12604 72.12606 72.12609 72.12611 72.12615 72.12617 72.12620
[554] 72.12623 72.12626 72.12629 72.12631 72.12634 72.12636 72.12639
[561] 72.12642 72.12645 72.12648 72.12651 72.12654 72.12656 72.12659
[568] 72.12663 72.12667 72.12671 72.12674 72.12678 72.12681 72.12683
[575] 72.12685 72.12688 72.12692 72.12696 72.12699 72.12702 72.12704
[582] 72.12707 72.12710 72.12713 72.12717 72.12720 72.12723 72.12726
[589] 72.12727 72.12729 72.12731 72.12732 72.12733 72.12734 72.12736
[596] 72.12738 72.12740 72.12742 72.12744 72.12745 72.12746 72.12748
[603] 72.12748 72.12749 72.12750 72.12751 72.12753 72.12752 72.12750
[610] 72.12749 72.12749 72.12748 72.12747 72.12745 72.12744 72.12744
[617] 72.12743 72.12742 72.12742 72.12741 72.12741 72.12740 72.12738
[624] 72.12736 72.12736 72.12736 72.12735 72.12733 72.12732 72.12731
[631] 72.12731 72.12730 72.12729 72.12729 72.12728 72.12727 72.12725
[638] 72.12725 72.12725 72.12724 72.12723 72.12723 72.12722 72.12720
[645] 72.12718 72.12717 72.12716 72.12714 72.12713 72.12710 72.12709
[652] 72.12706 72.12704 72.12701 72.12698 72.12694 72.12691 72.12687
[659] 72.12683 72.12680 72.12677 72.12674 72.12671 72.12667 72.12663
[666] 72.12660 72.12656 72.12652 72.12648 72.12644 72.12640 72.12637
[673] 72.12632 72.12629 72.12626 72.12624 72.12621 72.12619 72.12619
[680] 72.12620 72.12622 72.12624 72.12627 72.12630 72.12634 72.12637
[687] 72.12639 72.12640 72.12643 72.12645 72.12648 72.12651 72.12654
[694] 72.12656 72.12658 72.12661 72.12663 72.12667 72.12669 72.12672
[701] 72.12675 72.12678 72.12681 72.12685 72.12687 72.12689 72.12690
[708] 72.12692 72.12694 72.12696 72.12699 72.12701 72.12703 72.12704
[715] 72.12704 72.12706 72.12709 72.12713 72.12717 72.12718 72.12720
[722] 72.12722 72.12725 72.12726 72.12728 72.12730 72.12731 72.12733
[729] 72.12735 72.12738 72.12739 72.12741 72.12742 72.12745 72.12749
[736] 72.12751 72.12753 72.12754 72.12756 72.12757 72.12757 72.12758
[743] 72.12760 72.12761 72.12763 72.12766 72.12768 72.12770 72.12772
[750] 72.12775 72.12775 72.12776 72.12777 72.12778 72.12781 72.12783
[757] 72.12785 72.12788 72.12790 72.12793 72.12797 72.12799 72.12802
[764] 72.12804 72.12806 72.12808 72.12810 72.12813 72.12815 72.12818
[771] 72.12820 72.12822 72.12824 72.12828 72.12831 72.12834 72.12836
[778] 72.12838 72.12839 72.12840 72.12843 72.14064 72.14063 72.14058
[785] 72.14054 72.14050 72.14047 72.14044 72.14041 72.14038 72.14034
[792] 72.14031 72.14027 72.14024 72.14020 72.14016 72.14011 72.14009
[799] 72.14005 72.14002 72.13998 72.13995 72.13992 72.13988 72.13984
[806] 72.13981 72.13979 72.13974 72.13970 72.13966 72.13963 72.13960
[813] 72.13957 72.13953 72.13949 72.13945 72.13942 72.13939 72.13936
[820] 72.13933 72.13930 72.13927 72.13923 72.13919 72.13916 72.13913
[827] 72.13909 72.13906 72.13902 72.13899 72.13896 72.13893 72.13889
[834] 72.13885 72.13881 72.13877 72.13874 72.13871 72.13868 72.13864
[841] 72.13861 72.13859 72.13855 72.13852 72.13848 72.13844 72.13841
[848] 72.13837 72.13833 72.13829 72.13825 72.13821 72.13817 72.13814
[855] 72.13811 72.13807 72.13804 72.13800 72.13797 72.13793 72.13789
[862] 72.13786 72.13782 72.13779 72.13775 72.13772 72.13768 72.13764
[869] 72.13761 72.13758 72.13754 72.13751 72.13748 72.13745 72.13741
[876] 72.13737 72.13734 72.13729 72.13726 72.13722 72.13718 72.13714
[883] 72.13710 72.13707 72.13703 72.13700 72.13696 72.13692 72.13688
[890] 72.13685 72.13681 72.13678 72.13674 72.13671 72.13668 72.13665
[897] 72.13661 72.13657 72.13654 72.13650 72.13647 72.13643 72.13639
[904] 72.13636 72.13632 72.13628 72.13625 72.13621 72.13617 72.13614
[911] 72.13611 72.13608 72.13604 72.13601 72.13598 72.13595 72.13592
[918] 72.13588 72.13585 72.13582 72.13578 72.13574 72.13570 72.13567
[925] 72.13563 72.13560 72.13557 72.13553 72.13550 72.13546 72.13542
[932] 72.13540 72.13537 72.13534 72.13531 72.13527 72.13524 72.13521
[939] 72.13517 72.13513 72.13510 72.13507 72.13503 72.13499 72.13496
[946] 72.13493 72.13490 72.13487 72.13483 72.13480 72.13476 72.13473
[953] 72.13469 72.13466 72.13462 72.13458 72.13454 72.13451 72.13447
[960] 72.13443 72.13440 72.13436 72.13433 72.13429 72.13426 72.13422
[967] 72.13419 72.13415 72.13411 72.13409 72.13406 72.13402 72.13399
[974] 72.13396 72.13392 72.13389 72.13385 72.13381 72.13378 72.13374
[981] 72.13371 72.13367 72.13364 72.13362 72.13359 72.13355 72.13352
[988] 72.13348 72.13345 72.13341 72.13337 72.13333 72.13329 72.13326
[995] 72.13322 72.13318 72.13315 72.13312 72.13309 72.13306
[ reached getOption("max.print") -- omitted 107367 entries ]
latitude <- df_1$lat
qmplot(lon, lat, data = df_1, maptype = "toner-lite", color = I("red"))Using zoom = 4...
#plotting static map which does not require Mapbox Access Token
latitude <- df_1$lat
longitude <- df_1$lon
library(dplyr)
library(plotly)
fig_1 <- df
fig_1 <- fig_1 %>%
plot_ly(
lat = latitude,
lon = longitude,
marker = list(color = "dark red"),
type = 'scattermapbox',
hovertext = df[,"ele"])
fig_1 <- fig_1 %>%
layout( title = "All routes travelled, scroll to Boston",
mapbox = list(
style = 'open-street-map',
zoom =2.5,
center = list(lon = 72.23048, lat = 21.68353)))
fig_1No scattermapbox mode specifed:
Setting the mode to markers
Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
No scattermapbox mode specifed:
Setting the mode to markers
Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
#Next step : https://www.strava.com/heatmap#7.00/-120.90000/38.36000/hot/all
#I am planning to do something like this where I get to visualise the most travelled route, simple logic would be to iterate over every single coordinates and the number of occurance of those coordinates will be considered as one, where we calculate the frequency of the coordinates.
df2 = as.character(select(df_1, (df_1$lat > lat_min) & (df_1$lat < lat_max) &
(df_1$lon > lat_min) & (df_1$lon < lat_max)))
Error: Must subset columns with a valid subscript vector.
x Subscript has the wrong type `logical`.
ℹ It must be numeric or character.
Run `rlang::last_error()` to see where the error occurred.
min(longitude)
[1] -71.1048